/**
 * @desc   用户
 * @param  {String}
 * @return {Boolean} 
 */

/* layout */
import Layout from '../views/layout/Layout';

/* logiLayout */
const logiLayout = resolve => require(['../views/layout/logiLayout'], resolve);


// 用户管理
const userManage = resolve => require(['../views/userManage/userManage'], resolve);

//学校管理
const schoolManages = resolve => require(['../views/schoolManage/schoolManages'], resolve);
const leaderInfo = resolve => require(['../views/schoolManage/leaderInfo'], resolve); //负责人详情  
const addSchool = resolve => require(['../views/schoolManage/addSchool'], resolve); //添加学校信息
const modifySchool = resolve => require(['../views/schoolManage/modifySchool'], resolve); //修改学校信息


// 学生管理 --- cm
const studentManage = resolve => require(['../views/studentManagement/studentManage'], resolve);
const addStudentPage = resolve => require(['../views/studentManagement/comps/addStudentPage'], resolve);
const classInforPage = resolve => require(['../views/studentManagement/comps/classInforPage'], resolve);
const studentInforPage = resolve => require(['../views/studentManagement/comps/studentInforPage'], resolve);

// 班级管理 
const classStudent = resolve => require(['../views/classAdministration/classStudent'], resolve);
const studentList = resolve => require(['../views/classAdministration/studentList'], resolve);
const addNewStudent = resolve => require(['../views/classAdministration/addNewStudent'], resolve);
const classDetails = resolve => require(['../views/classAdministration/classDetails'], resolve);

//家长管理
const parentManage = resolve => require(['../views/parentManagement/parentManage'], resolve);
const checkParentManage = resolve => require(['../views/parentManagement/checkParentManage'], resolve); //查看信息

//经销商管理
const agentManagement = resolve => require(['../views/agentMangement/agentManagement'], resolve);
const addAgent = resolve => require(['../views/agentMangement/addAgent'], resolve);
const reviseAgent = resolve => require(['../views/agentMangement/reviseAgent'], resolve);

// 教师管理
const teacherManage = resolve => require(['../views/teacherManage/teacherManage'], resolve);
const correct = resolve => require(['../views/teacherManage/correct'], resolve);
const teacherClass = resolve => require(['../views/teacherManage/teacherClass'], resolve); //任教班级
//公司员工管理
const staffManagementes = resolve => require(['../views/staffManagement/staffManagementes'], resolve);
const addStaff = resolve => require(['../views/staffManagement/addStaff'], resolve);
const modifyStaff = resolve => require(['../views/staffManagement/modifyStaff'], resolve);
// 学生信息反馈

// const studInforFeedBack = resolve => require(['../views/studInforFeedBack/studInforFeedBack'], resolve);
// 用户
export const userManageRouterMap = [{
        path: '/',
        redirect: '/userManage',
        name: '用户',
        hidden: true
    }, {
        path: '/userManage',
        redirect: '/userManage/userManage',
        name: 'e学云用户管理',
        component: Layout,
        icon: 'theme',
        meta: { role: ['admin', '用户管理'], cache: 'userManage' },
        noDropdown: true,
        children: [
            { path: 'userManage', component: userManage, name: 'e学云用户管理' },
        ]
    }, {
        path: '/schoolManage',
        redirect: '/schoolManage/schoolManages',
        name: '基础管理',
        component: Layout,
        icon: 'zujian',
        meta: { role: ['admin', 'boss'], cache: 'teacherManage,schoolManages,parentManage,studentManage,classStudent,classDetails' },
        noDropdown: false,
        children: [{
                path: '/schoolManage',
                component: logiLayout,
                name: '学校管理',
                noDropdown: true,
                redirect: '/schoolManage/schoolManages',
                children: [
                    { path: 'schoolManages', component: schoolManages },
                    { path: 'leaderInfo/:schoolId', component: leaderInfo, name: '负责人信息' },
                    { path: 'addSchool', component: addSchool, name: '添加学校' },
                    { path: 'modifySchool/:schoolId', component: modifySchool, name: '修改学校信息' }

                ]
            },
            {
                path: '/teacherManage',
                component: logiLayout,
                name: '教师管理',
                noDropdown: true,
                redirect: '/teacherManage/teacherManage',
                children: [
                    { path: 'teacherManage', component: teacherManage },
                    { path: 'correct/:teacherId', component: correct, name: '修改' },
                    { path: 'teacherClass/:teacherId', component: teacherClass, name: '任教班级' },
                ]
            },
            {
                path: '/studentManage',
                component: logiLayout,
                name: '学生管理',
                noDropdown: true,
                meta: {
                    cache: 'studentManage'
                },
                redirect: '/studentManage/studentManage',
                children: [
                    { path: 'studentManage', component: studentManage },
                    { path: 'addStudentPage', component: addStudentPage, name: '新增学生' },
                    { path: 'classInforPage/:studentId?', component: classInforPage, name: '班级信息' },
                    { path: 'studentInforPage/:studentId?/:classObj?', component: studentInforPage, name: '学生信息' }
                ]
            },
            {
                path: '/classStudent',
                component: logiLayout,
                name: '班级管理',
                noDropdown: true,
                redirect: '/classStudent/classStudent',
                children: [{
                        path: 'classStudent',
                        component: classStudent
                    },
                    {
                        path: 'studentList/:id?',
                        component: studentList,
                        name: '班级学生'
                    },
                    {
                        path: 'addNewStudent/:schoolId?/:classId?/:id?',
                        component: addNewStudent,
                        name: '班级新增学生'
                    },
                    {
                        path: 'classDetails/:classId?',
                        component: classDetails,
                        name: '班级详情'
                    }
                ]
            },
            {
                path: '/parentManagement',
                component: logiLayout,
                name: '家长管理',
                noDropdown: true,
                redirect: '/parentManagement/parentManage',
                children: [
                    { path: 'parentManage', component: parentManage },
                    { path: 'checkParentManage/:userId?/:parentId?', component: checkParentManage, name: '查看家长信息' },

                ]
            },
            // {
            //     path: '/studInforFeedBack',
            //     component: logiLayout,
            //     name: '学生信息反馈',
            //     noDropdown: true,
            //     redirect: '/studInforFeedBack/studInforFeedBack',
            //     children: [
            //         { path: 'studInforFeedBack', component: studInforFeedBack },
            //     ]
            // },
        ],
    },
    {
        path: '/agentManagement',
        redirect: '/agentManagement/agentManagement',
        name: '经销商管理',
        component: Layout,
        icon: 'zonghe',
        meta: { cache: 'agentManagement' },
        noDropdown: true,
        children: [
            { path: 'agentManagement', component: agentManagement, },
            { path: 'addAgent', component: addAgent, name: '添加经销商' },
            { path: 'reviseAgent/:agentId', component: reviseAgent, name: '修改经销商' },
        ]
    },
    {
        path: '/staffManagement',
        redirect: '/staffManagement/staffManagementes',
        name: '公司员工管理',
        component: Layout,
        icon: 'xinrenzhinan',
        meta: { cache: 'staffManagementes' },
        noDropdown: true,
        children: [
            { path: 'staffManagementes', component: staffManagementes, },
            { path: 'addStaff', component: addStaff, name: '添加员工信息' },
            { path: 'modifyStaff/:orgUserId?/:roleId?/:userName?', component: modifyStaff, name: '修改员工信息' },
        ]
    },
]
export default userManageRouterMap